local skel = fk.CreateSkill {
  name = "emo__renquan",
}

Fk:loadTranslationTable{
  ["emo__renquan"] = "人权",
  [":emo__renquan"] = "连招技，（装备牌+【杀】），你可以摸两张牌，每摸一张非【杀】牌，本阶段【杀】的上限+1。",
}

skel:addEffect(fk.CardUsing, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and
      data.extra_data and data.extra_data.combo_skill and data.extra_data.combo_skill[skel.name]
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local cards = player:drawCards(2, skel.name)
    if player.dead then return end
    for _, id in ipairs(cards) do
      if Fk:getCardById(id).trueName ~= "slash" then
        room:addPlayerMark(player, MarkEnum.SlashResidue .. "-phase", 1)
      end
    end
  end,
})

skel:addEffect(fk.AfterCardUseDeclared, {
  can_refresh = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name, true) and data.card.trueName == "slash"
  end,
  on_refresh = function (self, event, target, player, data)
    local room = player.room
    local use_events = room.logic:getEventsByRule(GameEvent.UseCard, 2, function (e)
      return e.data.from == player
    end, 1)
    if #use_events == 2 and use_events[2].data.card.type == Card.TypeEquip then
      data.extra_data = data.extra_data or {}
      data.extra_data.combo_skill = data.extra_data.combo_skill or {}
      data.extra_data.combo_skill[skel.name] = true
    end
  end,
})

return skel
